4 #include "ResourceMaster.h"
5 #include "SDLGraphics.h"
11 #include "LevelSelect.h"
12 #include "MusicRoom.h"
15 #include "ModeSelect.h"
20 #include "ScreenNames.h"
22 //Go over changes and fix syntax errors
26 //soft loss and hard end
29 SFX and BGM contain pointers to all the sound files and all the ways to work with sound
30 These have a password to the storage zips
31 ResourceMaster contains pointers and origonals for all resources in the game.
32 The renderer is created here
33 It holds the way to change screen size
34 FileIO takes stuff out of the storage zips to be located into the rescourcemaster.
35 It has a password to the storage zips
36 It handles saving and loading of all data
37 It has the complex and simple methods of fileIO for zip and raw
38 SDLGraphics sets up the window and starts loading things with the FileIO class.
39 Create load screen creates the load screen after loading all textures into memory
40 A new thread loads runs a bg image and the old thread loads the sound files.
41 The creation of the thread starts loading the sound files
42 Inside the main, integers and booleans manage the games life cycle
44 Language screen loads the languages with flags
45 Main Menu is the interface
46 Settigns holds settings
47 Music room holds animations and sounds
48 Quit dealocates everything.
52 int main(int argc
, char** argv
) {
54 SFX
* sfxPtr
= new SFX();
55 BGM
* bgmPtr
= new BGM();
56 ResourceMaster
* resourcePointer
= new ResourceMaster(sfxPtr
, bgmPtr
);
57 FileIO
* fileIO
= new FileIO(resourcePointer
);
59 SDLGraphics
* fullInit
= new SDLGraphics(fileIO
, resourcePointer
);
60 fullInit
->startThread();
61 fullInit
->createLoadScreen();
63 int* screen
= new int;
64 *screen
= LanguageScreen
;
66 std::cout
<< "lol" << i
+ 1 << "\n";
67 bool runningMain
= true;
70 case LanguageScreen
: {
71 Language
lang(screen
, fileIO
, resourcePointer
);
72 fileIO
->loadAnimationsZipPast(30);
75 case MainMenuScreen
: {
76 Menu
menu(screen
, fileIO
, resourcePointer
);
79 case SettingsScreen
: {
80 Settings
settings(screen
, fileIO
, resourcePointer
);
83 case MusicRoomScreen
: {
84 MusicRoom
musRoom(screen
, fileIO
, resourcePointer
);
88 SDL_DestroyRenderer(resourcePointer
->rendPtr
);
89 SDL_DestroyWindow(resourcePointer
->window
);
90 delete resourcePointer
;
101 case LevelSelectScreen
: {
102 LevelSelect
lvlsel(screen
, fileIO
, resourcePointer
);
107 ModeSelect
mode(screen
, fileIO
, resourcePointer
);
108 if (!mode
.getSkip()) {
109 int gameType
= mode
.getGameMode();
113 else if (gameType
== 2) {
116 EndCard
ec(screen
, 0, fileIO
, resourcePointer
, gameType
, 1);
121 ModeSelect
mode(screen
, fileIO
, resourcePointer
);
122 if (!mode
.getSkip()) {
123 int gameType
= mode
.getGameMode();
124 Level3
l3(gameType
, fileIO
, resourcePointer
, mode
.getAnimations());
126 int score
= l3
.getScore();
127 EndCard
ec(screen
, score
, fileIO
, resourcePointer
, gameType
, 3);
129 else if (gameType
== 2) {
130 int hearts
= l3
.getHearts();
131 EndCard
ec(screen
, hearts
, fileIO
, resourcePointer
, gameType
, 3);